import registnet.dao.CollegePeer;
import registnet.dao.UnitPeer;
import registnet.dao.CoursePeer;
import registnet.dao.DegreeCoursePeer;
import registnet.dao.Course;

CoursePeer coursePeer = new CoursePeer();
DegreeCoursePeer degreeCoursePeer = new DegreeCoursePeer();

String instance = "Enlistment";

/* [start] 	initializes gui variables */

	RegistNetPropertyBundle bundle = RegistNetPropertyBundle.getInstance("/resources/registnet");
	int semester = (new registnet.dao.SystemPropertiesPeer().getSystemProperties().getSemester()+1)%3;
	int year = new registnet.dao.SystemPropertiesPeer().getSystemProperties().getAcademicYear();
	if(semester == 3) year++;
	String semYearValue = "";
	if(semester == 3)
		semYearValue = (year-1)+"-"+year;
	else
		semYearValue = year+"-"+(year+1);
	semYearValue = semYearValue + ":" + resources.Constants.MAP_SEMESTER_VALUE.get(semester);
	String studentNameValue = "";
	String studentNumberValue = "";
	String degreeValue = "";
	
/* [end] */


/* [start]	prepares the tree */

	ArrayList parentList = new ArrayList();
	Map mapSTN_parent = new HashMap();
	Map mapAL_parent = new HashMap();
	Map mapAL_child = new HashMap();
	Map mapAL_grandchild = new HashMap();
	Map map_treeitem = new HashMap();
	SimpleTreeNode root = new SimpleTreeNode("ROOT", parentList);
	
/* [end] */


/* [start]	defines the renderer for the tree */

	public class MyTreeitemRenderer implements TreeitemRenderer {
		public void render(Treeitem item, Object data) throws Exception {
			String str = data.toString();
			Treerow tr = null;
			Treecell tc = new Treecell(str);
			if(item.getTreerow()==null){
				tr = new Treerow();
				tr.setParent(item);
				map_treeitem.put(str, item);
			}else{
				tr = item.getTreerow(); 
				tr.getChildren().clear();
			}
			tc.setParent(tr);
		}
	}
	
/* [end] */


/* [start]	puts objects on the tree */
			
	public void retrieveObjects(){
	
		map_treeitem.clear();
		mapSTN_parent.clear();
		mapAL_parent.clear();
		mapAL_child.clear();
		mapAL_grandchild.clear();
		parentList.clear();
		
		if(instance.equals("Enlistment") || instance.equals("Course Offerings") ){
			tree_label.setLabel("Units");
			
			List colleges = new Vector();
			colleges = new CollegePeer().getAllColleges();
			
			for(int i=0; i<colleges.size(); i++){
				List units;
				units = new UnitPeer().getUnitByCollege(colleges.get(i).getCollegeId());
				ArrayList alChild = new ArrayList();
				ArrayList alLeaf = new ArrayList();
				for(int j=0; j<units.size(); j++){
					SimpleTreeNode stnChild = new SimpleTreeNode(units.get(j).getUnitCode(), new ArrayList());
					alLeaf.add(units.get(j).getUnitCode());
					alChild.add(stnChild);
				}
				SimpleTreeNode stnParent = new SimpleTreeNode(colleges.get(i).getCollegeCode(), alChild);
				mapSTN_parent.put(colleges.get(i).getCollegeCode(), stnParent);
				mapAL_parent.put(colleges.get(i).getCollegeCode(), alChild);
				mapAL_child.put(colleges.get(i).getCollegeCode(), alLeaf);
				parentList.add(stnParent);
			}
		}
		else if(instance.equals("Classlist")){
			tree_label.setLabel("Courses");
			
			List colleges = new Vector();
			colleges = new CollegePeer().getAllColleges();
			
			for(int i=0; i<colleges.size(); i++){
				List units = new Vector();
				units = new UnitPeer().getUnitByCollege(colleges.get(i).getCollegeId());
				ArrayList alChild = new ArrayList();
				
				for(int j=0; j<units.size(); j++){
					List courses = new Vector();
					courses = coursePeer.getCoursesByUnit(units.get(j).getUnitId());
					ArrayList alGrandChild = new ArrayList();
					ArrayList alLeaf = new ArrayList();
					for(int k=0; k<courses.size(); k++){
						SimpleTreeNode stnGrandChild = new SimpleTreeNode(courses.get(k).getCourseCode(), new ArrayList());
						alLeaf.add(courses.get(k).getCourseCode());
						alGrandChild.add(stnGrandChild);
					}
					
					SimpleTreeNode stnChild = new SimpleTreeNode(units.get(j).getUnitCode(), alGrandChild);
					//alLeaf.add(units.get(j).getUnitCode());
					alChild.add(stnChild);
					mapAL_child.put(units.get(j).getUnitCode(), alGrandChild);
					//mapAL_grandchild.put(colleges.get(i).getCollegeCode(), alLeaf);
				}
				SimpleTreeNode stnParent = new SimpleTreeNode(colleges.get(i).getCollegeCode(), alChild);
				mapSTN_parent.put(colleges.get(i).getCollegeCode(), stnParent);
				mapAL_parent.put(colleges.get(i).getCollegeCode(), alChild);
				parentList.add(stnParent);
			}
		}
		else if(instance.equals("Student Form 5")){
			tree_label.setLabel("Students");
			
			List colleges = new Vector();
			colleges = new CollegePeer().getAllColleges();
			
			for(int i=0; i<colleges.size(); i++){
				List degrees = degreeCoursePeer.getDegreeCourseByCollege(colleges.get(i).getCollegeId());
				ArrayList alChild = new ArrayList();
				
				for(int j=0; j<degrees.size(); j++){
					List students = new Vector();
					students = new registnet.dao.StudentPeer().getActiveStudentsByDegree(degrees.get(j).getDegreeId());
					HashMap studentMap = new HashMap();
					for(int k=0; k<students.size(); k++){
						registnet.dao.Student student = students.get(k);
						String batch = student.getStudentNumber().substring(0, 4);
						if (!studentMap.containsKey(batch)){
							studentMap.put(batch, new ArrayList());
						}
						studentMap.get(batch).add(student.getStudentNumber());
					}
					ArrayList alGrandChild = new ArrayList();
					Iterator ite = studentMap.keySet().iterator();
					while(ite.hasNext()){
						String batch = ite.next();
						ArrayList alGrandGrandChild = new ArrayList();
						ArrayList alLeaf = new ArrayList();
						for(int k=0; k<studentMap.get(batch).size(); k++){
							SimpleTreeNode stnGrandGrandChild = new SimpleTreeNode(studentMap.get(batch).get(k), new ArrayList());
							alLeaf.add(studentMap.get(batch).get(k));
							alGrandGrandChild.add(stnGrandGrandChild);
						}
						SimpleTreeNode stnGrandChild = new SimpleTreeNode(batch, studentMap.get(batch));
						alGrandChild.add(stnGrandChild);
						mapAL_grandchild.put(batch,alGrandGrandChild);
					}
					
					SimpleTreeNode stnChild = new SimpleTreeNode(degrees.get(j).getDegreeCode(), alGrandChild);
					alChild.add(stnChild);
					mapAL_child.put(degrees.get(j).getDegreeCode(), alGrandChild);
				}
				SimpleTreeNode stnParent = new SimpleTreeNode(colleges.get(i).getCollegeCode(), alChild);
				mapSTN_parent.put(colleges.get(i).getCollegeCode(), stnParent);
				mapAL_parent.put(colleges.get(i).getCollegeCode(), alChild);
				parentList.add(stnParent);
			}
		}
		else{
			tree_label.setLabel("Degree Programs");
			List colleges = new Vector();
			colleges = new CollegePeer().getAllColleges();
			
			for(int i=0; i<colleges.size(); i++){
				List degrees = degreeCoursePeer.getDegreeCourseByCollege(colleges.get(i).getCollegeId());
				ArrayList alChild = new ArrayList();
				ArrayList alLeaf = new ArrayList();
				for(int j=0; j<degrees.size(); j++){
					SimpleTreeNode stnChild = new SimpleTreeNode(degrees.get(j).getDegreeCode(), new ArrayList());
					alLeaf.add(degrees.get(j).getDegreeCode());
					alChild.add(stnChild);
				}
				SimpleTreeNode stnParent = new SimpleTreeNode(colleges.get(i).getCollegeCode(), alChild);
				mapSTN_parent.put(colleges.get(i).getCollegeCode(), stnParent);
				mapAL_parent.put(colleges.get(i).getCollegeCode(), alChild);
				mapAL_child.put(colleges.get(i).getCollegeCode(), alLeaf);
				parentList.add(stnParent);
			}
			
		}
		
		SimpleTreeNode root = new SimpleTreeNode("ROOT", parentList);
		SimpleTreeModel stm = new SimpleTreeModel(root);
		instance_tree.setModel(stm);
		instance_tree.setTreeitemRenderer(new MyTreeitemRenderer());
	}
	
/* [end] */


/* [start]	defines an event listener for the items on the tree;
			when the item is selected, its info is displayed */
			
	private class SelectEventListener implements EventListener {	
		public SelectEventListener (){}
		
		public void onEvent(Event event) throws UiException {
			showInfo();
		}
	}
	
/* [end] */


/* [start] displays the info of the selected item */

	void showInfo(){
		isShowingInfo = true;
		isSearching = false;
		try{
			if (instance_tree.getSelectedCount() == 1){
				if(instance.equals("Student Form 5")){
					if(instance_tree.getSelectedItem().getLabel().length()==10 && instance_tree.getSelectedItem().getLabel().indexOf('-')==4){
						loadContents(title.getValue());
					}else
						title.setValue(title.getValue());
				}
				else if(!instance.equals("Classlist")){
					if (instance_tree.getSelectedItem().getParentItem() != null){
						loadContents(title.getValue());
					}
					else
						title.setValue(title.getValue());
				}
				else{
					if ((mapAL_child.containsKey(instance_tree.getSelectedItem().getParentItem().getLabel())) && (instance_tree.getSelectedItem().getParentItem() != null)){
						loadContents(title.getValue());
					}
					else
						title.setValue(title.getValue());
				}
			}
		}catch (Exception e) { }
	}
	
/* [end] */


/* [start]	Table renderers */

	private class Table5Renderer implements ListitemRenderer  {
		public void render(Listitem row, java.lang.Object data) {
			new Listcell(data[0]).setParent(row);
			new Listcell(data[1]).setParent(row);
			new Listcell(data[2]).setParent(row);
			new Listcell(data[3]).setParent(row);
			new Listcell(data[4]).setParent(row);
		}
	}

	private class Table4Renderer implements ListitemRenderer  {
		public void render(Listitem row, java.lang.Object data) {
			new Listcell(data[0]).setParent(row);
			new Listcell(data[1]).setParent(row);
			new Listcell(data[2]).setParent(row);
			new Listcell(data[3]).setParent(row);
		}
	}
	
	private class Table3Renderer implements ListitemRenderer  {
		public void render(Listitem row, java.lang.Object data) {
			new Listcell(data[0]).setParent(row);
			new Listcell(data[1]).setParent(row);
			new Listcell(data[2]).setParent(row);
		}
	}
	
	private class Table1Renderer implements RowRenderer{
		public void render(Row row, java.lang.Object data){
			new Label(data[0]).setParent(row);
		}
		
	}
	
	private class Grid5Renderer implements RowRenderer{
		public void render(Row row, java.lang.Object data){
			if (data[1] != null){
				new Label(data[0]).setParent(row);
				new Label(data[1]).setParent(row);
				new Label(data[2]).setParent(row);
				new Label(data[3]).setParent(row);
				new Label(data[4]).setParent(row);
			}
			else if(data[0].equals("")){
				Label label = new Label(data[0]);
				label.setParent(row);
				row.setSpans("5");
				row.setHeight("25px");
				row.setStyle("border-top: 2px solid #4f7fbf; background-color: #ffffff; ");
			}
			else{
				Label label = new Label(data[0]);
				label.setStyle("font-weight: bold");
				label.setParent(row);
				row.setSpans("5");
				row.setStyle("border-top: 2px solid #4f7fbf; border-bottom: 2px solid #4f7fbf; background-color: #BCD2EF;");
			}
		}
	}
		
	private class Grid6Renderer implements RowRenderer{
		public void render(Row row, java.lang.Object data){
			if (data[1] != null){
				new Label(data[0]).setParent(row);
				new Label(data[1]).setParent(row);
				new Label(data[2]).setParent(row);
				new Label(data[3]).setParent(row);
				new Label(data[4]).setParent(row);
				new Label(data[5]).setParent(row);
			}
			else if(data[0].equals("")){
				Label label = new Label(data[0]);
				label.setParent(row);
				row.setSpans("6");
				row.setHeight("25px");
				row.setStyle("border-top: 2px solid #4f7fbf; background-color: #ffffff; ");
			}
			else{
				Label label = new Label(data[0]);
				label.setStyle("font-weight: bold");
				label.setParent(row);
				row.setSpans("6");
				row.setStyle("border-top: 2px solid #4f7fbf; border-bottom: 2px solid #4f7fbf; background-color: #BCD2EF;");
			}
		}
	}
	
/* [end] */


/* [start] load contents of table */
	
	void loadContents(String type){
		if(type.equals("Enlistment")){
			daoUnit = new UnitPeer().getUnit(instance_tree.getSelectedItem().getLabel());
			List daoCourses = coursePeer.getCoursesByUnit(daoUnit.getUnitId());
			String[][] listModel = new String[daoCourses.size()][5];
			int semester = (new registnet.dao.SystemPropertiesPeer().getSystemProperties().getSemester()+1)%3;
			int year = new registnet.dao.SystemPropertiesPeer().getSystemProperties().getAcademicYear();
			if(semester == 3) year++;
			
			int ctr = 0;
			for(Course daoCourse : daoCourses){
				
				//course
				listModel[ctr][0] = daoCourse.getCourseCode();
				
				//course demand
				try{
					listModel[ctr][1] = "" + new registnet.dao.CourseDemandPeer().getCourseDemand(daoCourse.getCourseId()).getEstimatedDemand();
				}catch(Exception e){
					listModel[ctr][1] = "-";
					listModel[ctr][2] = "-";
					listModel[ctr][3] = "-";
					listModel[ctr][4] = "-";
					ctr++;
					continue;
				}
				
				int enlistedStudentCount = 0;
				int availableSlots = 0;
				int studentCount = 0;
				for(registnet.dao.CourseOffering courseOffering : new registnet.dao.CourseOfferingPeer().getCourseOfferings(daoCourse.getCourseId(),semester,year)){
					studentCount = studentCount + courseOffering.getStudentCount();
					try{
						int tmpSlots = new registnet.dao.CourseOfferingSlotPeer().getCourseOfferingSlot(courseOffering.getCourseOfferingId()).getRemainingSlotCount();
						availableSlots = availableSlots + tmpSlots;
					}catch(Exception e){ e.printStackTrace(); }
				}
				//enlisted students
				listModel[ctr][2] = "" + (studentCount - availableSlots);
				//slots offered
				listModel[ctr][3] = "" + studentCount;
				//remaining slots
				listModel[ctr][4] = "" + availableSlots;
				ctr++;
			}
			ListModel strset = new SimpleListModel(listModel);
			contents.getFellow("enlistment_listbox").setModel(strset);
			contents.getFellow("enlistment_listbox").setItemRenderer(new Table5Renderer());
		}
		
		else if(type.equals("Course Offerings")){
			daoUnit = new UnitPeer().getUnit(instance_tree.getSelectedItem().getLabel());
			List courses = coursePeer.getCoursesByUnit(daoUnit.getUnitId());
			ListIterator liCourses = courses.listIterator();
			List list = new Vector();
			int size = 0;
			while(liCourses.hasNext()){
				Course course = liCourses.next();
				int semester = (new registnet.dao.SystemPropertiesPeer().getSystemProperties().getSemester()+1)%3;
				int year = new registnet.dao.SystemPropertiesPeer().getSystemProperties().getAcademicYear();
				if(semester == 3) year++;
				List sections = new registnet.dao.CourseOfferingPeer().getCourseOfferings(course.getCourseId(),semester,year);
				list.add(sections);
				size = size + sections.size() + 2;
			}
			String[][] data = new String[size][5];
			liCourses = courses.listIterator();
			int ctr = 0; int courseCtr = 0;
			while(liCourses.hasNext()){
				Course course = liCourses.next();
				data[ctr][0] = course.getCourseCode();
				Iterator ite = list.get(courseCtr).iterator();
				courseCtr++;
				ctr++;
				while(ite.hasNext()){
					registnet.dao.CourseOffering section = ite.next();
					//section
					data[ctr][0] = section.getCourseOfferingName();
					//lecture
					data[ctr][1] = section.getLectureDay() + " " + section.getLectureTime();
					//laboratory
					data[ctr][2] = section.getLaboratoryDay() + " " + section.getLaboratoryTime();
					//recitation
					data[ctr][3] = section.getRecitationDay() + " " + section.getRecitationTime();
					if(!data[ctr][3].contains("-")) data[ctr][3] = "";
					//slot
					try{
						data[ctr][4] = "" + (new registnet.dao.CourseOfferingSlotPeer()).getCourseOfferingSlot(section.getCourseOfferingId()).getRemainingSlotCount();
					}catch(Exception e){
						data[ctr][4] = " ";
					}
					ctr++;
				}
				data[ctr][0] = "";
				ctr++;
			}
			ListModel strset = new SimpleListModel(data);
			contents.getFellow("course_offerings_grid").setModel(strset);
			contents.getFellow("course_offerings_grid").setRowRenderer(new Grid5Renderer());
		}
		else if(type.equals("Classlist")){
			int semester = (new registnet.dao.SystemPropertiesPeer().getSystemProperties().getSemester()+1)%3;
			int year = new registnet.dao.SystemPropertiesPeer().getSystemProperties().getAcademicYear();
			if(semester == 3) year++;
			List sections = new registnet.dao.CourseOfferingPeer().getCourseOfferings(coursePeer.getCourse(instance_tree.getSelectedItem().getLabel()).getCourseId(),semester,year);
			ListIterator liSections = sections.listIterator();
			int size = 0;
			while(liSections.hasNext()){
				registnet.dao.CourseOffering section = liSections.next();
				size = size + section.getStudentCount() + 2;
				contents.getFellow("classlist_grid").setPageSize(section.getStudentCount()+2);
			}
			String[][] data = new String[size][6] ;
			
			liSections = sections.listIterator();
			int ctrSection = 0;
			int ctr = 0;
			while(liSections.hasNext()){
				registnet.dao.CourseOffering section = liSections.next();
				data[ctr][0] = section.getCourseOfferingName();
				ctr++;
				List slots = new registnet.dao.SlotPeer().getAllSlotsByCourseOffering(section.getCourseOfferingId());
				ListIterator liSlots = slots.listIterator();
				for(int i=0; i<section.getStudentCount(); i++){
					data[ctr][0] = "" + (i+1);
					if(liSlots.hasNext()){
						registnet.dao.Slot slot = (registnet.dao.Slot)liSlots.next();
						registnet.dao.Student student = new registnet.dao.Student();
						try{
							student = slot.getStudent();
						}catch(Exception e){ }
						data[ctr][1] = student.getStudentNumber();
						data[ctr][2] = student.getLastName();
						data[ctr][3] = student.getFirstName();
						data[ctr][4] = student.getMiddleName();
						data[ctr][5] = resources.Constants.MAP_SLOT_STATUS_KEY.get(slot.getStatus());
					}else{
						data[ctr][1] = "";
						data[ctr][2] = "";
						data[ctr][3] = "";
						data[ctr][4] = "";
						data[ctr][5] = "";
					}
					ctr++;
				}
				data[ctr][0]="";
				ctr++;
			}
			ListModel strset = new SimpleListModel(data);
			contents.getFellow("classlist_grid").setModel(strset);
			contents.getFellow("classlist_grid").setRowRenderer(new Grid6Renderer());
		}
		else if(type.equals("Student Form 5")){
			registnet.dao.Student student = new registnet.dao.StudentPeer().getStudent(instance_tree.getSelectedItem().getLabel());
			studentNameValue = student.getFirstName() + " " + student.getMiddleName() + ". " + student.getLastName();
			studentNumberValue = student.getStudentNumber();
			degreeValue = student.getCurriculum().getDegreeCourse().getDegreeCode();
			contents.getFellow("student_name_l").setValue(studentNameValue);
			contents.getFellow("student_number_l").setValue(studentNumberValue);
			contents.getFellow("degree_l").setValue(degreeValue);
			
			List slots = new registnet.dao.SlotPeer().getAllSlots(student.getStudentId());
			String[][] listModel = new String[slots.size()][4];
			ListIterator li = slots.listIterator();
			int totalUnits = 0;
			int ctr = 0;
			while(li.hasNext()){
				registnet.dao.Slot slot = li.next();
				registnet.dao.CourseOffering section = slot.getCourseOffering();
				Course course = section.getCourse();
				listModel[ctr][0] = course.getCourseCode();
				listModel[ctr][1] = course.getCourseDescription();
				listModel[ctr][2] = section.getCourseOfferingName();
				listModel[ctr][3] = "" + course.getUnits();
				totalUnits = totalUnits + course.getUnits();
				ctr++;
			}
			ListModel strset = new SimpleListModel(listModel);
			contents.getFellow("listbox_form5").setModel(strset);
			contents.getFellow("listbox_form5").setItemRenderer(new Table4Renderer());
			contents.getFellow("total_units_l").setValue("" +totalUnits);
		}
		else if(type.equals("Temporary Summary")){
			degreeCourse = degreeCoursePeer.getDegreeCourse(instance_tree.getSelectedItem().getLabel());
			registnet.dao.StudentPeer daoStudentPeer = new registnet.dao.StudentPeer();
			List listDaoStudents;
			String[][] listModel;
		
			listDaoStudents = daoStudentPeer.getActiveStudentsByDegree(degreeCourse.getDegreeId());
			ListIterator li = listDaoStudents.listIterator();
			listModel= new String[listDaoStudents.size()][4];
			
			int ctr=0;
			while(li.hasNext()){
				registnet.dao.Student daoStudent;
				try{
					daoStudent = (registnet.dao.Student)li.next();
					listModel[ctr][0] = daoStudent.getStudentNumber();
					listModel[ctr][1] = daoStudent.getFirstName();
					listModel[ctr][2] = daoStudent.getLastName();
					listModel[ctr][3] = "";
					try{
						ListIterator li0 = new registnet.dao.SlotPeer().getAllSlots(daoStudent.getStudentId()).listIterator();
						while(li0.hasNext()){
						registnet.dao.Slot slot = (registnet.dao.Slot)li0.next();
							listModel[ctr][3] = listModel[ctr][3] + "'"+slot.getCourseOffering().getCourse().getCourseCode()+"(" + slot.getCourseOffering().getCourseOfferingName() + ")' \r\n";
						}
					}
					catch(Exception e){ listModel[ctr][3] = ""; }
					
				}catch(Exception e){
					System.err.println(e.getMessage());
					continue;
				}
				ctr++;
			}
			
			ListModel strset = new SimpleListModel(listModel);
			contents.getFellow("listbox_temporary_summary").setModel(strset);
			contents.getFellow("listbox_temporary_summary").setItemRenderer(new Table4Renderer());
		}
		
	}
	
/* [end] */


/* [start] 	show main enlistment page */

	void showEnlistment(){
		if (contents.getFirstChild() != null){
			contents.removeChild(contents.getFirstChild());
		}
		contents.appendChild(Executions.createComponents("../../WEB-INF/macros/registration/enlistmentform.zul", contents, null));
		title.setValue("Enlistment");
		instance = "Enlistment";
		retrieveObjects();
		showInfo();
	}
	
/* [end] */


/* [start] 	show course offerings */

	void showCourseOfferings(){
		if (contents.getFirstChild() != null){
			contents.removeChild(contents.getFirstChild());
		}
		contents.appendChild(Executions.createComponents("../../WEB-INF/macros/registration/course_offerings.zul", contents, null));
		title.setValue("Course Offerings");
		instance = "Course Offerings";
		retrieveObjects();
		showInfo();
	}
	
/* [end] */


/* [start] 	show classlist */

	void showClasslist(){
		if (contents.getFirstChild() != null){
			contents.removeChild(contents.getFirstChild());
		}
		contents.appendChild(Executions.createComponents("../../WEB-INF/macros/registration/classlist.zul", contents, null));
		title.setValue("Classlist");
		instance = "Classlist";
		retrieveObjects();
		showInfo();
	}
	
/* [end] */


/* [start] 	show student form 5 */

	void showStudentForm5(){
		if (contents.getFirstChild() != null){
			contents.removeChild(contents.getFirstChild());
		}
		contents.appendChild(Executions.createComponents("../../WEB-INF/macros/registration/studentform5.zul", contents, null));
		title.setValue("Student Form 5");
		instance = "Student Form 5";
		retrieveObjects();
		showInfo();
	}
	
/* [end] */


/* [start] 	show temporary summary */

	void showTemporarySummary(){
		if (contents.getFirstChild() != null){
			contents.removeChild(contents.getFirstChild());
		}
		contents.appendChild(Executions.createComponents("../../WEB-INF/macros/registration/temporary_summary.zul", contents, null));
		title.setValue("Temporary Summary");
		instance = "Temporary Summary";
		retrieveObjects();
		showInfo();
	}
	
/* [end] */












